home *** CD-ROM | disk | FTP | other *** search
Wrap
on getVolume splitPosn = offset("\", the moviePath) volumeName = (the moviePath).char[1..splitPosn] return volumeName end on fileExists path_file fileTest = new(xtra("fileio")) openfile(fileTest, path_file, 1) fileResult = status(fileTest) closeFile(fileTest) if fileResult = 0 then return 1 else return 0 end if end on launch targetPath if targetPath.char[1..4] = "http" then gotoNetPage(targetPath, "_new") else if targetPath.char[1..8] = "local://" then localHTML = getVolume() & targetPath.char[9..targetPath.length] gotoNetPage(unescapePath(localHTML), "_new") else if targetPath.char[1..6] = "alert:" then alert(targetPath.char[7..targetPath.length]) else if targetPath.char[1..6] = "mailto" then fileXtraObj = xtra("FileXtra4").new() myDocsPath = fileXtraObj.fx_FolderGetSpecialPath("CSIDL_WINDOWS") myDocsPath = myDocsPath.char[1..3] shortcutFile = myDocsPath & "PCProjects.url" fileIOObj = new xtra("fileio") if fileExists(shortcutFile) then fileIOObj.openfile(shortcutFile, 2) delete fileIOObj fileIOObj.closeFile() end if fileIOObj = new xtra("fileio") fileIOObj.createFile(shortcutFile) fileIOObj.openfile(shortcutFile, 2) fileIOObj.writeString("[InternetShortcut]") fileIOObj.writeReturn(#windows) fileIOObj.writeString("URL=" & targetPath) fileXtraObj.fx_FileOpenDocument(shortcutFile) fileIOObj.closeFile() fileXtraObj = 0 fileIOObj = VOID else launchByExtension(targetPath) end if end if end if end if end on launchByExtension targetPath pathLen = targetPath.length startPosn = offset(".", targetPath.char[pathLen - 4..pathLen]) if targetPath.char[2..3] = ":\" then fullPath = targetPath else fullPath = getVolume() & targetPath end if fileXtra = xtra("FileXtra4").new() case targetPath.char[pathLen - 4 + startPosn..pathLen] of "exe": runResult = fileXtra.fx_FileRunApp(fullPath) "msi": msiHandler = fileXtra.fx_FileGetAppPath(".msi") if msiHandler contains "msiexec" then launchStr = QUOTE & targetPath & QUOTE open("/I" && QUOTE & targetPath & QUOTE, "msiexec.exe") else alert("Windows Installer 2.0 has could not be found. It is required to install this software. Please check the system requirements box for a link to the Microsoft website") end if runResult = 1 "hta": htaHandler = fileXtra.fx_FileGetAppPath(".hta") if htaHandler contains "mshta" then open(QUOTE & targetPath & QUOTE, "mshta.exe") else alert("Microsoft HTML Application host could not be found. Please contact technical support for assistance and ask them to report error code Launch_HTA to the developer") end if otherwise: if fileXtra.fx_FolderExists(fullPath) then open(unescapePath(fullPath), "explorer") runResult = 1 else if fileXtra.fx_FileExists(fullPath) then runResult = fileXtra.fx_FileOpenDocument(fullPath) end if end if end case fileXtra = 0 if runResult = 0 then alert("Failed to open: " & fullPath) end if end on getBannerType targetPath pathLen = targetPath.length startPosn = offset(".", targetPath.char[pathLen - 4..pathLen]) case targetPath.char[pathLen - 4 + startPosn..pathLen] of "swf": return #flash "gif": return #animGif "jpeg", "jpg": return #bitmap end case end on unescapePath targetPath escapePosn = offset("\\", targetPath) if escapePosn = 0 then return targetPath else return targetPath.char[1..escapePosn] & unescapePath(targetPath.char[escapePosn + 2..targetPath.length]) end if end